package model.thedata;


/**
 * An enumeration for the gamemodes...
 * there are different GameModes which have different 
 * specials
 */
public enum GameMode {
	
	/**
	 * the normal worms with corners and everything
	 * if you walk against the wall you're down
	 * implementation for the first Release
	 */
	CORNER(0), 
	/**
	 * A special mode because there are no corners 
	 * if you walk left outside the view your head
	 * comes from the left side
	 * implementation for the secound Release
	 */
	NONCORNER(1), 
	/**
	 * the random modes mixes every gamemode... it switches
	 * ingame from corner to nonconer mode very funny :)
	 * implementation later 3rd or 4th Release
	 */
	RANDOM(100);
	
	/**
	 * the value for switch between these Enums...
	 */
	private int value;
	
	GameMode(int value){
		this.setValue(value);
	}

	/**
	 * @param value the value to set
	 */
	public void setValue(int value) {
		this.value = value;
	}

	/**
	 * @return the value
	 */
	public int getValue() {
		return value;
	}
	
	/**
	 * a method to become the GameMode value
	 * @param mode the gameMode
	 * @return integer of the game mode
	 */
	public int getPrevious(GameMode mode){
		switch (mode) {
		case CORNER: return 0;
		case NONCORNER: return 1;
		case RANDOM: return 100;
		default: return 0;
		}
	}

	public GameMode getGameMode(int valueOfNext) {
		switch (valueOfNext) {
		case 0: return CORNER;
		case 1: return NONCORNER;
		case 100: return RANDOM;
		default: return CORNER;
		}
	}
}
